function nav_name(config)
{
	return config.force_all?"list_nav_level_all":"list_nav_level";
}

exports.add=[{
	_type:"controller",
	_config_details: {
		
	},
	_config: {
		name: "NavSubnav",
		index_view:"index",
		parent_id:null
	},
	/**
	 * Controller: NavSubnav.index
	 *		Renders subnavigation
	 *
	 * Returns:
	 *		HTML
	 */
	index: function(config) {
		var t=this;
		this.F("Nav","calc");
		this.configNavSubnav=config;
		this.nav_subnav=this.site.models.Page.ListHier(nav_name(config),{parent_id:config.parent_id||this.pageinfo.id,user_id:this.uid});
		this.nav_subnav.forEach(function(n) {
			if (t.calc_pages.active[n.id]) n.active=1;
			if (n.alias==t.action) n.fully_active=1;
		});
		return this.Cview();
	}
}];

